#!/usr/local/bin/python
# This python script retrieves Pubmed records
# Eg: python queryEntrez.py 21124488 
# Requires Biopython
# Look here for help with Efetch:
# http://www.ncbi.nlm.nih.gov/corehtml/query/static/efetchlit_help.html

import sys

from Bio import Medline
from Bio import Entrez

Entrez.email = "jimmysaw@gmail.com"
#handle = Entrez.esearch(db="nucleotide",term="Cypripedioideae[Orgn] AND matK[Gene]")
#handle = Entrez.efetch(db="protein", id="186972394", rettype="gb")
#handle = Entrez.efetch(db="taxonomy", id="9685", rettype="xml")
#record = Entrez.read(handle)
#print record["Count"]
#print record["IdList"]


handle = Entrez.efetch(db="pubmed", id=sys.argv[1], rettype="medline", retmode="text")

#records = Entrez.read(handle)

print handle.read() 
